package com.wgq.TestRongQi;

import java.util.*;

public class UtilTest <T> {
    //只有引用类型可以用泛型.Object不用能泛型
    private ArrayList<T>[] name;
    public  void  add(int index, ArrayList<T> arrayList){
        name[index] = arrayList;

    }
    public  ArrayList<T>  get(int index){
        for (Iterator lt  = name[index].iterator();lt.hasNext();){
          return   (ArrayList<T>)(lt.next());
        }
        return null;
    }
    public static <T> void TestUtil(){

    }
    public static void main(String[] args) {
     //   UtilTest ut =new UtilTest();
        Map map = new HashMap();
        map.put("王1","国庆");
        map.put("王2","老五");
        //map中 key 中是否有 "王"
        map.containsKey("王");
        //map中 value 中是否有 "国庆"
        map.containsValue("国庆");
        Set set = map.keySet();
        for (Iterator it = set.iterator();it.hasNext();){
            System.out.println( it.next());
        }


    }
}
